package com.bluezone.dec.system.controller;

import com.bluezone.dec.common.JsonResult;
import com.bluezone.dec.system.entity.EntRelRect;
import com.bluezone.dec.system.service.EntRelRectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author HHL
 * @description 企业专项整治计划关联
 * @date 2018/10/12 - 10:20
 */
@Api(tags = "专项行动数据录入/企业专项整治计划关联")
@RestController
@RequestMapping("/dec/related")
public class EnterpriseRelatedRectificationPlanController {

    @Autowired
    private EntRelRectService entRelRectService;

    @ApiOperation("企业专项整治计划关联 通过专项整治计划Id查询与其相关的企业")
    @GetMapping("/plan-rel-ent")
    public JsonResult findPlanRelEntByRectPlanId(@RequestParam(value = "rectPlanId", required = true) String rectPlanId) {
        List<EntRelRect> planRelEntList = null;
        planRelEntList = entRelRectService.findPlanRelEntByRectPlanId(rectPlanId);
        return new JsonResult().ok(planRelEntList);
    }

}
